home *** CD-ROM | disk | FTP | other *** search
/ QRZ! Ham Radio 4 / QRZ Ham Radio Callsign Database - Volume 4.iso / files / dsp / drbubtxt / toolstar.z / toolstar / tools / srec.doc < prev    next >
Text File  |  1992-04-28  |  8KB  |  206 lines

  1.     NAME
  2.         srec - convert Motorola DSP load file records to
  3.                S-record format
  4.  
  5.     SYNOPSIS
  6.         srec [-blmrsw] <input file ... >
  7.  
  8.     DESCRIPTION
  9.         Srec takes as input a Motorola DSP absolute load file and
  10.         produces byte-wide Motorola S-record files suitable for
  11.         PROM burning.  The Motorola DSP START and END records are
  12.         mapped into S0 and S7/S9 records respectively.  All other
  13.         DSP record types are mapped into S1 or S3-type records
  14.         depending on the source processor.  SYMBOL and COMMENT records
  15.         are currently ignored.
  16.  
  17.         Since Motorola DSPs use different word sizes, the words
  18.         must be split into bytes and stored in an appropriate format.
  19.         The program examines the machine type field in the load
  20.         file start record to determine the appropriate S-record
  21.         format to use.  For example, if the machine ID in the START
  22.         record is DSP56000 or DSP56016, srec generates S1/S9 output
  23.         records; if the machine ID is DSP96000, the program generates
  24.         S3/S7 records.
  25.  
  26.         In the default mode of operation the program writes the
  27.         low, middle, and high bytes of each word
  28.         consecutively to the current S1/S3 record being written.  For
  29.         example, given the DSP56000 DATA record below:
  30.  
  31.                 address field
  32.                 |
  33.             _DATA P 0000
  34.             0008F8 300000 340000 094E3E
  35.             |      |      |      |
  36.             |      |      |      fourth word
  37.             |      |      third word
  38.             |      second word
  39.             first word
  40.  
  41.         srec would create the following S1 record:
  42.  
  43.               byte count field
  44.               | address  field              checksum field
  45.               | |                           |
  46.             S10D0000F808000000300000343E4E09F9
  47.                     |     |     |     |
  48.                     |     |     |     fourth word
  49.                     |     |     third word
  50.                     |     second word
  51.                     first word
  52.  
  53.         Output records are written to a file named according to
  54.         the following convention:
  55.  
  56.             <basename>.M
  57.  
  58.         where <basename> is the filename of the input load file
  59.         without extension and M is the memory space specifier
  60.         (X, Y, L, or P) for this set of data words.  Note that a
  61.         separate file is created for each memory space encountered
  62.         in the input file; thus the maximum number of output files
  63.         in the default mode is 4.
  64.  
  65.         When the -m option is specified, srec splits each DSP source
  66.         word into bytes and stores the bytes in parallel S1/S3
  67.         records.  For example, the following DSP56000 DATA record:
  68.  
  69.                 address field
  70.                 |
  71.             _DATA P 0000
  72.             0008F8 300000 340000 094E3E
  73.             |      |      |      |
  74.             |      |      |      fourth word
  75.             |      |      third word
  76.             |      second word
  77.             first word
  78.  
  79.         would be converted by srec into the three S1 records below:
  80.  
  81.               byte count field
  82.               | address  field
  83.               | |
  84.             S1070000F800003EC2 -- low  byte
  85.             S10700000800004EA2 -- mid  byte
  86.             S1070000003034098B -- high byte
  87.                 | | | | |
  88.                 | | | | checksum field
  89.                 | | | fourth word
  90.                 | | third word
  91.                 | second word
  92.                 first word
  93.  
  94.         The three records corresponding to the high, middle, and
  95.         low bytes of each data word are written to separate files.
  96.         The files are named according to the following convention:
  97.  
  98.             <basename>.<M><#>
  99.  
  100.         where <basename> is the filename of the input load file
  101.         without extension, <M> is the memory space specifier
  102.         (X, Y, L, or P) for this set of data words, and # is
  103.         one of the digits 0, 1, or 2 corresponding to low, middle,
  104.         and high bytes, respectively.
  105.  
  106.         Note that a separate set of byte-wide files is created for
  107.         each memory space encountered in the input file.  Thus the
  108.         number of output files generated is (number of memory spaces
  109.         in input * size of DSP word).
  110.  
  111.         The -s option writes all information to a single file,
  112.         storing the memory space information in the address field
  113.         of the S0 header record.  The values stored in the address
  114.         field and their correspondence to the DSP56000 memory
  115.         spaces are as follows:
  116.  
  117.             Value        DSP56000 Memory Space
  118.             -----        ---------------------
  119.               1            X
  120.               2            Y
  121.               3            L
  122.               4            P
  123.  
  124.         When the memory space changes in the DATA or BLOCKDATA
  125.         record, a new S0 header record is generated.  The resulting
  126.         output file is named <basename>.s, where <basename> is
  127.         the filename of the input load file without extension.
  128.         The -m and -s options are mutually exclusive.
  129.  
  130.         The -r option causes srec to write bytes high to low rather
  131.         than low to high in the default and -s modes.  It has no
  132.         affect when the -m option is given.
  133.  
  134.         Address fields in DSP load records are copied as is to
  135.         the appropriate S1 or S3 record.  Subsequent S1 or S3
  136.         record addresses are byte incremented until a new DATA
  137.         record is encountered or end-of-file is reached.  In some
  138.         cases the starting S1/S3 record address must be adjusted for
  139.         byte addressing by multiplying the load record start address
  140.         by the number of bytes in a DSP56000 word.  When the -b
  141.         option is given, any DATA record address fields are adjusted
  142.         to begin on a byte-multiple address.  If the -w option is
  143.         specified (the default) byte-incrementing is not done
  144.         when generating S-record addresses, e.g. the S-record
  145.         addresses are word-oriented rather than byte-oriented.
  146.         The -b and -w options have no effect when used in conjunction
  147.         with the -m mode, since in that case byte and word address
  148.         mappings are 1:1.
  149.  
  150.         DATA records for L space memory contain words which are loaded
  151.         into adjacent X and Y memory locations.  In these cases
  152.         performing the default strict word addressing may be
  153.         inappropriate.  The -l option can be given to indicate
  154.         that double-word addressing should be used to generate
  155.         subsequent S1/S3 addresses after the initial load address.
  156.         In addition the -l option should be used when doing byte
  157.         addressing since the initial load addresses must be adjusted
  158.         to account for double-word addressing in the load file.
  159.         In general, it is a good idea to use the -l option whenever
  160.         the source load file contains DATA records which refer to
  161.         L memory space.
  162.  
  163.         In the START record only the module id is passed as header
  164.         data for the S0 record; the version number, revision number,
  165.         and comment are ignored.  As noted earlier, the machine ID
  166.         field is used to determine what type of S-records to generate
  167.         based on the addressing range of the DSP processor.
  168.  
  169.     OPTIONS
  170.         -b    - use byte addressing when transferring load addresses
  171.               to S-record addresses.  This means that load file
  172.               DATA record start addresses are multiplied by
  173.               the DSP bytes/word and subsequent S1/S3 record
  174.               addresses are computed based on the data byte count.
  175.         -l    - use double-word addressing when transferring load
  176.               addresses from L space to S-record addresses.  This
  177.               means that load file DATA records for L space data
  178.               are moved unchanged and subsequent S1/S3 record
  179.               addresses are computed based on the data word count
  180.               divided by 2.  This option should always be used
  181.               when the source load file contains DATA records in L
  182.               memory space.
  183.         -m    - split each DSP word into bytes and store
  184.               the bytes in parallel S-records.   Replaces
  185.               the -3 option.  The -m and -s options are
  186.               mutually exclusive.
  187.         -r    - write bytes high to low, rather than low to
  188.               high.  Has no effect when used with -m option.
  189.         -s    - write data to a single file, putting memory
  190.               space information into the address field of the
  191.               S0 header record. Replaces the -1 option.
  192.               Bytes may be reversed with the -r option.
  193.               The -m and -s options are mutually exclusive.
  194.         -w    - use word addressing when transferring load addresses
  195.               to S-record addresses.  This means that load file
  196.               DATA record start addresses are moved unchanged and
  197.               subsequent S1/S3 record addresses are computed
  198.               based on the data word count.
  199.  
  200.     DIAGNOSTICS
  201.         The program does some checking for invalid input record
  202.         formats, memory spaces, and hex values.  It obviously
  203.         cannot check for bad data values if the load file has
  204.         been tampered with.  Both START and END records must be
  205.         found in the input file.
  206.